#include <bits/stdc++.h>
using namespace std;

int main() {
    int frac_num;
    cin >> frac_num;

    long long mul_num = 1;
    long long mul_denum = 1;
    bool mul_symbol = true;

    long long tmp_num , tmp_denum;
    bool tmp_symbol;
    for (int i = 0; i < frac_num; ++i) {
        cin >> tmp_num >> tmp_denum;
        tmp_symbol = (tmp_num/tmp_denum >= 0 ?true:false);
        mul_num *= abs(tmp_num);
        mul_denum *= abs(tmp_denum);
        mul_symbol = (mul_symbol^tmp_symbol?false:true);

        // 化约
        long long tmp_common = min(mul_num, mul_denum);
        while (mul_num%tmp_common != 0 || (mul_denum%tmp_common != 0)) {
            tmp_common--;
        }
        mul_num /= tmp_common;
        mul_denum /= tmp_common;
    }
    if (mul_num == 0) {
        cout << 0;
    } else if (mul_num == 1 && (mul_denum == 1)) {
        cout << (mul_symbol?"":"-") << 1;
    } else {
        cout << (mul_symbol?"":"-") << mul_num << '/' << mul_denum;
    }
}